<!DOCTYPE html>
<html lang="ch-cn" xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>
<body>

    <nav th:replace="layouts::navbar"></nav>

<!--HTML模板中的project对象是从是从控制层来的，所以我们在控制层中，在displayProjectForm方法中传入Model对象。-->
<!--Spring框架的Model对象用于在控制层和视图层之间交换数据。-->
    <div class="container">
        <form action="/projects/save" th:object="${project}" method="POST">
            <br>
            <div class="form-group">
                <div class="col-sm-6">
                    <input class="form-control" type="text" placeholder="项目名称" th:field="*{name}">
                </div>
            </div>
            <br>
            <div class="form-group">
                <div class="col-sm-6">
                    <select class="form-control" th:field="*{stage}">
                        <option th:value="未开始">未开始</option>
                        <option th:value="进行中">进行中</option>
                        <option th:value="已完成">已完成</option>
                    </select>
                </div>
            </div>
            <br>
            <div class="form-group">
                <div class="col-sm-6">
                    <textarea class="form-control" type="text" placeholder="输入项目描述" th:field="*{description}"></textarea>
                </div>
            </div>
            <br>
            <div class="form-group">
                <div class="col-sm-6">
                    <select class="form-control" th:field="*{students}" multiple="multiple">
                        <option th:each="student : ${allStudents}" th:value="${student.studentId}" th:text="${student.name}"></option>
                    </select>
                </div>
            </div>
            <br>

            <button type="submit" class="btn btn-info">新建项目</button>
        </form>
    </div>
</body>
</html>